package com.acoffee.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author acoffee
 * @create 2021-11-22 15:28
 */
@Controller
@RequestMapping(value = "/restful")
public class UserController {

//    @PostMapping(value = "/acoffee/{id}")
//    public ModelAndView user(@PathVariable int id, ModelAndView model){
//        model.addObject("msg",id);
//        model.setViewName("go");
//        System.out.println(id);
//        return model;
//    }
//    @GetMapping(value = "/acoffee/{id}/{uid}")
//    public String user(@PathVariable int id,@PathVariable int uid){
//        System.out.println(id+"----------"+uid);
//        return null;
//    }

    @PutMapping(value = "/acoffee/{id}")
    public String modelTest(@PathVariable int id,Model model){
        model.addAttribute("msg",id);
        System.out.println(id);
        return "/go";
    }
}
